package ch09_异常与处理;

public class LoginUI1 {
	public static void main(String[] args) {
		LoginService1 service  =new LoginService1();

		switch (service.login("admin", "admin")) {
			case EMPTY_USERNAME:
				System.err.println("登录失败，用户名不能为空！");
				break;
			case EMPTY_PASSWORD:
				System.err.println("登录失败，密码不能为空！");
				break;
			case INVALID_USER:
				System.err.println("登录失败，用户名或密码错误！");
				break;
			case FORBIDDEN_USER:
				System.err.println("登录失败，用户名已被禁用！");
				break;
			case SUCCESS:
				System.out.println("登录成功！");
				break;
			default:
				System.err.println("登录失败，未知错误！");
				break;
		}
	}
}
